from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from user.models import User


# Create your views here.

def home(request):
    return HttpResponse('user_home')


@csrf_exempt
def add_user(request):
    user_name = request.POST.get('name')

    user = User()
    user.user_name = user_name
    user.save()

    return JsonResponse({
        'message': "successfully join us"
    })
